export class Log {
  private debug_enabled:boolean=false

  /**
   * 打开日志输出
   * <p>Turn on the log output</p>
   */
  public debugEnable():void{
    this.debug_enabled=true
  }

  /**
   * 关闭日志输出
   * <p>Turn off the log output</p>
   */
  public debugDisable():void{
    this.debug_enabled=false
  }
  public info=(message:any, ...params:any[])=>{
    if (this.debug_enabled) {
      console.log(message, ...params)
    }
  }
  public warn=(message:any,...params:any[]):void=>{
    if (this.debug_enabled) {
      console.warn(message,...params)
    }
  }
  public error=(message:any,...params:any[]):void=>{
    if (this.debug_enabled) {
      console.error(message,...params)
    }
  }
}

export const log=new Log()
export default log
